package com.bestbuy.pojo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

/**
 * @author ThanhNgo
 *
 */
@Entity
@Table(name = "bill")
public class Bill {
	@Id
	@Column(name = "IDBILL")
	@GeneratedValue
    private Integer idbill;
	
	@ManyToOne
    @JoinColumn(name="IDACCOUNT")
	@Fetch(FetchMode.JOIN)
    private Account account;
    
	@ManyToOne
    @JoinColumn(name="IDCART")
	@Fetch(FetchMode.JOIN)
    private Cart cart;
    
    @Column(name = "DATECREATED")
    private Date datecreated;
    
    @Column(name = "ISPAID")
    private Integer ispaid;
    
    @Column(name = "ISDELETED")
    private Integer isdeleted;

	public Integer getIdbill() {
		return idbill;
	}

	public void setIdbill(Integer idbill) {
		this.idbill = idbill;
	}

	public Account getAccount() {
		return account;
	}

	public void setAccount(Account account) {
		this.account = account;
	}

	public Cart getCart() {
		return cart;
	}

	public void setCart(Cart cart) {
		this.cart = cart;
	}

	public Date getDatecreated() {
		return datecreated;
	}

	public void setDatecreated(Date datecreated) {
		this.datecreated = datecreated;
	}

	public Integer getIspaid() {
		return ispaid;
	}

	public void setIspaid(Integer ispaid) {
		this.ispaid = ispaid;
	}

	public Integer getIsdeleted() {
		return isdeleted;
	}

	public void setIsdeleted(Integer isdeleted) {
		this.isdeleted = isdeleted;
	}

	public Bill(Integer idbill, Account account, Cart cart, Date datecreated,
			Integer ispaid, Integer isdeleted) {
		super();
		this.idbill = idbill;
		this.account = account;
		this.cart = cart;
		this.datecreated = datecreated;
		this.ispaid = ispaid;
		this.isdeleted = isdeleted;
	}

	public Bill() {
		super();
		// TODO Auto-generated constructor stub
	}
    
    
}
